home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / mus / play / multiplsr.lha / jamplay.asm < prev    next >
Assembly Source File  |  1992-09-14  |  20KB  |  639 lines

  1. * MultiPlayer
  2. * Copyright (C) 1992 Bryan Ford
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. *
  18. * I (the author of MultiPlayer) can be contacted on the Internet at
  19. * "bryan.ford@m.cc.utah.edu".  See "Player.doc" for other addresses.
  20. *
  21. * Note:  This playroutine was not originally written by me.  In general
  22. * these playroutines are public domain, so I am bringing the versions
  23. * modified for MultiPlayer under the General Public License.  In the
  24. * few cases of already-copyrighted playroutines, the above copyright
  25. * notice applies only to the parts of the file written by me.
  26. *
  27. * $Id: jamplay.asm,v 4.1 92/06/21 11:14:19 BAF Exp Locker: BAF $
  28. *
  29.  
  30.         include "exec/types.i"
  31.         include "bry/macros.i"
  32.         include "player.i"
  33.  
  34.         xref    modmem,getfreqmodspeed,intrepeat,intsongpos,dmawait
  35.  
  36.         xdef    jamstart
  37.  
  38.         code    text
  39.  
  40. jamstart
  41.         plstartret 9$
  42.  
  43.         cnop    0,4
  44.         dc.l    gmod_Jump
  45. 9$      gmodnop
  46.         gmodbra _pp_init                ; StartMusic
  47.         gmodbra _pp_end                 ; StopMusic
  48.         gmodnop
  49.         gmodnop
  50.         gmodq   1                       ; ContinueMusic
  51.         gmodnop
  52.         gmodnop
  53.         gmodnop
  54.         gmodnop
  55.         gmodnop
  56.         gmodnop
  57.         gmodnop
  58.         gmodnop
  59.         gmodnop
  60.         gmodbra getfreqmodspeed         ; GetFrequency
  61.         gmodbra _pp_music               ; TimerTick
  62.         gmodbra 2$                      ; GetMakerName
  63.         move.l  #GMODHF_REPEAT!GMODHF_SEQUENCE,d0       ; Hook
  64.         rts
  65.  
  66. 2$      lea     name(pc),a0
  67.         move.l  a0,d0
  68.         rts
  69.  
  70.  
  71.  
  72.  
  73. *                  ****************************************
  74. *                  *** JamCrackerPro V1.0a play-routine ***
  75. *                  ***   Originally coded by M. Gemmel  ***
  76. *                  ***           Code optimised         ***
  77. *                  ***         by Xag of Betrayal       ***
  78. *                  ***    See docs for important info   ***
  79. *                  ****************************************
  80.  
  81. *** Relative offset definitions ***
  82.  
  83.  STRUCTURE Instrument,0         ;Instrument info structure
  84.         STRUCT  it_name,31
  85.         BYTE    it_flags
  86.         LONG    it_size
  87.         LONG    it_address
  88.         LABEL   it_sizeof
  89.  
  90.  STRUCTURE Pattern,0            ;Pattern info structure
  91.         WORD    pt_size
  92.         LONG    pt_address
  93.         LABEL   pt_sizeof
  94.  
  95.  STRUCTURE Note,0               ;Note info structure
  96.         BYTE    nt_period
  97.         BYTE    nt_instr
  98.         BYTE    nt_speed
  99.         BYTE    nt_arpeggio
  100.         BYTE    nt_vibrato
  101.         BYTE    nt_phase
  102.         BYTE    nt_volume
  103.         BYTE    nt_porta
  104.         LABEL   nt_sizeof
  105.  
  106.  STRUCTURE Voice,0              ;Voice info structure
  107.         WORD    pv_waveoffset
  108.         WORD    pv_dmacon
  109.         LONG    pv_custbase
  110.         WORD    pv_inslen
  111.         LONG    pv_insaddress
  112.         LONG    pv_peraddress
  113.         STRUCT  pv_pers,3*2
  114.         WORD    pv_por
  115.         WORD    pv_deltapor
  116.         WORD    pv_porlevel
  117.         WORD    pv_vib
  118.         WORD    pv_deltavib
  119.         WORD    pv_vol
  120.         WORD    pv_deltavol
  121.         WORD    pv_vollevel
  122.         WORD    pv_phase
  123.         WORD    pv_deltaphase
  124.         BYTE    pv_vibcnt
  125.         BYTE    pv_vibmax
  126.         BYTE    pv_flags
  127.         BYTE    pv_pad
  128.         LABEL   pv_sizeof
  129.  
  130. *** Initialise routine ***
  131.  
  132. _pp_init:
  133. ; !!!!
  134.                 push.l  d0-d7/a0-a6
  135.                 move.l  modmem,a0
  136. ; !!!!
  137.                 addq.w  #4,a0
  138.                 move.w  (a0)+,d0
  139.                 move.w  d0,d1
  140.                 move.l  a0,instable
  141.                 mulu    #it_sizeof,d0
  142.                 add.w   d0,a0
  143.  
  144.                 move.w  (a0)+,d0
  145.                 move.w  d0,d2
  146.                 move.l  a0,patttable
  147.                 mulu    #pt_sizeof,d0
  148.                 add.w   d0,a0
  149.  
  150.                 move.w  (a0)+,d0
  151.                 move.w  d0,songlen
  152.                 move.l  a0,songtable
  153.                 add.w   d0,d0
  154.                 add.w   d0,a0
  155.  
  156.                 move.l  patttable(PC),a1
  157.                 move.w  d2,d0
  158.                 subq.w  #1,d0
  159. .l0:            move.l  a0,pt_address(a1)
  160.                 move.w  (a1),d3         ;pt_size
  161.                 mulu    #nt_sizeof*4,d3
  162.                 add.w   d3,a0
  163.                 addq.w  #pt_sizeof,a1
  164.                 dbra    d0,.l0
  165.  
  166.                 move.l  instable(PC),a1
  167.                 move.w  d1,d0
  168.                 subq.w  #1,d0
  169. .l1:            move.l  a0,it_address(a1)
  170.                 move.l  it_size(a1),d2
  171.                 add.l   d2,a0
  172.                 add.w   #it_sizeof,a1
  173.                 dbra    d0,.l1
  174.  
  175.                 movem.l d0-d1,-(sp)     ; BAF
  176.                 clr.l   songpos
  177.                 moveq   #0,d0
  178.                 moveq   #0,d1
  179.                 move.w  songlen(pc),d1
  180.                 jsr     intsongpos
  181.                 movem.l (sp)+,d0-d1
  182.  
  183.                 move.l  songtable(PC),pp_songptr
  184.                 move.w  songlen(PC),pp_songcnt
  185.                 move.l  pp_songptr(PC),a0
  186.                 move.w  (a0),d0
  187.                 mulu    #pt_sizeof,d0
  188.                 add.l   patttable(PC),d0
  189.                 move.l  d0,a0
  190.                 move.l  a0,pp_pattentry
  191.                 move.b  pt_size+1(a0),pp_notecnt
  192.                 move.l  pt_address(a0),pp_address
  193.                 move.b  #6,pp_wait
  194.                 move.b  #1,pp_waitcnt
  195.                 clr.w   pp_nullwave
  196.                 move.w  #$000F,$DFF096
  197.  
  198.                 lea     pp_variables(PC),a0
  199.                 lea     $DFF0A0,a1
  200.                 moveq   #1,d1
  201.                 move.w  #$80,d2
  202.                 moveq   #4-1,d0
  203. .l2:            move.w  #0,8(a1)
  204.                 move.w  d2,(a0)         ;pv_waveoffset
  205.                 move.w  d1,pv_dmacon(a0)
  206.                 move.l  a1,pv_custbase(a0)
  207.                 move.l  #pp_periods,pv_peraddress(a0)
  208.                 move.w  #1019,pv_pers(a0)
  209.                 clr.w   pv_pers+2(a0)
  210.                 clr.w   pv_pers+4(a0)
  211.                 clr.l   pv_por(a0)
  212.                 clr.w   pv_porlevel(a0)
  213.                 clr.l   pv_vib(a0)
  214.                 clr.l   pv_vol(a0)
  215.                 move.w  #$40,pv_vollevel(a0)
  216.                 clr.l   pv_phase(a0)
  217.                 clr.w   pv_vibcnt(a0)
  218.                 clr.b   pv_flags(a0)
  219.                 add.w   #pv_sizeof,a0
  220.                 add.w   #$10,a1
  221.                 add.w   d1,d1
  222.                 add.w   #$40,d2
  223.                 dbra    d0,.l2
  224.  
  225. ; !!!!
  226.                 pop.l   d0-d7/a0-a6
  227. ; !!!!
  228.                 rts
  229.  
  230. *** Clean-up routine ***
  231.  
  232. _pp_end:
  233. ; !!!!
  234.                 push.l  d0-d7/a0-a6
  235. ; !!!!
  236.                 moveq   #0,d0
  237.                 lea     $DFF000,a0
  238.                 move.w  d0,$A8(a0)
  239.                 move.w  d0,$B8(a0)
  240.                 move.w  d0,$C8(a0)
  241.                 move.w  d0,$D8(a0)
  242.                 move.w  #$000F,$96(a0)
  243. ; !!!!
  244.         pop.l   d0-d7/a0-a6
  245.         moveq.l #0,d0
  246. ; !!!!
  247.                 rts
  248. _pp_music:
  249.         push.l  d0-d7/a0-a6
  250.         bsr.s   pp_play
  251.         pop.l   d0-d7/a0-a6
  252.         rts
  253.  
  254. *** Play routine ***
  255.  
  256. pp_play:                lea     $DFF000,a6
  257.                 subq.b  #1,pp_waitcnt
  258.                 bne.s   \l0
  259.                 bsr     pp_nwnt
  260.                 move.b  pp_wait(PC),pp_waitcnt
  261.  
  262. \l0:            lea     pp_variables(PC),a1
  263.                 bsr.s   pp_uvs
  264.                 lea     pp_variables+pv_sizeof(PC),a1
  265.                 bsr.s   pp_uvs
  266.                 lea     pp_variables+2*pv_sizeof(PC),a1
  267.                 bsr.s   pp_uvs
  268.                 lea     pp_variables+3*pv_sizeof(PC),a1
  269.  
  270. pp_uvs:         move.l  pv_custbase(a1),a0
  271.  
  272. \l0:            move.w  pv_pers(a1),d0
  273.                 bne.s   \l1
  274.                 bsr     pp_rot
  275.                 bra.s   \l0
  276. \l1:            add.w   pv_por(a1),d0
  277.                 tst.w   pv_por(a1)
  278.                 beq.s   \l1c
  279.                 bpl.s   \l1a
  280.                 cmp.w   pv_porlevel(a1),d0
  281.                 bge.s   \l1c
  282.                 bra.s   \l1b
  283. \l1a:           cmp.w   pv_porlevel(a1),d0
  284.                 ble.s   \l1c
  285. \l1b:           move.w  pv_porlevel(a1),d0
  286.  
  287. \l1c:           add.w   pv_vib(a1),d0
  288.                 cmp.w   #135,d0
  289.                 bge.s   \l1d
  290.                 move.w  #135,d0
  291.                 bra.s   \l1e
  292. \l1d:           cmp.w   #1019,d0
  293.                 ble.s   \l1e
  294.                 move.w  #1019,d0
  295. \l1e:           move.w  d0,6(a0)
  296.                 bsr     pp_rot
  297.  
  298.                 move.w  pv_deltapor(a1),d0
  299.                 add.w   d0,pv_por(a1)
  300.                 cmp.w   #-1019,pv_por(a1)
  301.                 bge.s   \l3
  302.                 move.w  #-1019,pv_por(a1)
  303.                 bra.s   \l5
  304. \l3:            cmp.w   #1019,pv_por(a1)
  305.                 ble.s   \l5
  306.                 move.w  #1019,pv_por(a1)
  307.  
  308. \l5:            tst.b   pv_vibcnt(a1)
  309.                 beq.s   \l7
  310.                 move.w  pv_deltavib(a1),d0
  311.                 add.w   d0,pv_vib(a1)
  312.                 subq.b  #1,pv_vibcnt(a1)
  313.                 bne.s   \l7
  314.                 neg.w   pv_deltavib(a1)
  315.                 move.b  pv_vibmax(a1),pv_vibcnt(a1)
  316.  
  317. \l7:            move.w  pv_dmacon(a1),d0
  318.                 move.w  pv_vol(a1),8(a0)
  319.                 move.w  pv_deltavol(a1),d0
  320.                 add.w   d0,pv_vol(a1)
  321.                 tst.w   pv_vol(a1)
  322.                 bpl.s   \l8
  323.                 clr.w   pv_vol(a1)
  324.                 bra.s   \la
  325. \l8:            cmp.w   #$40,pv_vol(a1)
  326.                 ble.s   \la
  327.                 move.w  #$40,pv_vol(a1)
  328.  
  329. \la:            btst    #1,pv_flags(a1)
  330.                 beq.s   \l10
  331.                 tst.w   pv_deltaphase(a1)
  332.                 beq.s   \l10
  333.                 bpl.s   \sk
  334.                 clr.w   pv_deltaphase(a1)
  335. \sk:            move.l  pv_insaddress(a1),a0
  336.                 move.w  (a1),d0         ;pv_waveoffset
  337.                 neg.w   d0
  338.                 lea     0(a0,d0.w),a2
  339.                 move.l  a2,a3
  340.                 move.w  pv_phase(a1),d0
  341.                 lsr.w   #2,d0
  342.                 add.w   d0,a3
  343.  
  344.                 moveq   #$40-1,d0
  345. \lb:            move.b  (a2)+,d1
  346.                 ext.w   d1
  347.                 move.b  (a3)+,d2
  348.                 ext.w   d2
  349.                 add.w   d1,d2
  350.                 asr.w   #1,d2
  351.                 move.b  d2,(a0)+
  352.                 dbra    d0,\lb
  353.  
  354.                 move.w  pv_deltaphase(a1),d0
  355.                 add.w   d0,pv_phase(a1)
  356.                 cmp.w   #$100,pv_phase(a1)
  357.                 blt.s   \l10
  358.                 sub.w   #$100,pv_phase(a1)
  359.  
  360. \l10:           rts
  361.  
  362. pp_rot:         move.w  pv_pers(a1),d0
  363.                 move.w  pv_pers+2(a1),pv_pers(a1)
  364.                 move.w  pv_pers+4(a1),pv_pers+2(a1)
  365.                 move.w  d0,pv_pers+4(a1)
  366.                 rts
  367.  
  368. pp_nwnt:                move.l  pp_address(PC),a0
  369.                 add.l   #4*nt_sizeof,pp_address
  370.                 subq.b  #1,pp_notecnt
  371.                 bne.s   \l5
  372.  
  373. \l0:            movem.l d0-d1,-(sp)     ; BAF
  374.                 move.l  songpos(pc),d0
  375.                 addq.l  #1,d0
  376.                 move.l  d0,songpos
  377.                 moveq   #0,d1
  378.                 move.w  songlen(pc),d1
  379.                 jsr     intsongpos
  380.                 movem.l (sp)+,d0-d1
  381.  
  382.                 addq.l  #2,pp_songptr
  383.                 subq.w  #1,pp_songcnt
  384.                 bne.s   \l1
  385.                 move.l  songtable(PC),pp_songptr
  386.                 move.w  songlen(PC),pp_songcnt
  387.  
  388.                 jsr     intrepeat       ; BAF
  389.  
  390. \l1:            move.l  pp_songptr(PC),a1
  391.                 move.w  (a1),d0
  392.                 mulu    #pt_sizeof,d0
  393.                 add.l   patttable(PC),d0
  394.                 move.l  d0,a1
  395.                 move.b  pt_size+1(a1),pp_notecnt
  396.                 move.l  pt_address(a1),pp_address
  397.  
  398. \l5:            clr.w   pp_tmpdmacon
  399.                 lea     pp_variables(PC),a1
  400.                 bsr     pp_nnt
  401.                 addq.w  #nt_sizeof,a0
  402.                 lea     pp_variables+pv_sizeof(PC),a1
  403.                 bsr     pp_nnt
  404.                 addq.w  #nt_sizeof,a0
  405.                 lea     pp_variables+2*pv_sizeof(PC),a1
  406.                 bsr     pp_nnt
  407.                 addq.w  #nt_sizeof,a0
  408.                 lea     pp_variables+3*pv_sizeof(PC),a1
  409.                 bsr     pp_nnt
  410.  
  411.                 move.w  pp_tmpdmacon(PC),$96(a6)
  412.  
  413.                 jsr     dmawait
  414.  
  415.                 lea     pp_variables(PC),a1
  416.                 bsr.s   pp_scr
  417.                 lea     pp_variables+pv_sizeof(PC),a1
  418.                 bsr.s   pp_scr
  419.                 lea     pp_variables+2*pv_sizeof(PC),a1
  420.                 bsr.s   pp_scr
  421.                 lea     pp_variables+3*pv_sizeof(PC),a1
  422.                 bsr.s   pp_scr
  423.  
  424.                 bset    #7,pp_tmpdmacon
  425.                 move.w  pp_tmpdmacon(PC),$96(a6)
  426.  
  427.                 jsr     dmawait
  428.  
  429.                 move.l  pp_variables+pv_insaddress(PC),$A0(a6)
  430.                 move.w  pp_variables+pv_inslen(PC),$A4(a6)
  431.                 move.l  pp_variables+pv_sizeof+pv_insaddress(PC),$B0(a6)
  432.                 move.w  pp_variables+pv_sizeof+pv_inslen(PC),$B4(a6)
  433.                 move.l  pp_variables+2*pv_sizeof+pv_insaddress(PC),$C0(a6)
  434.                 move.w  pp_variables+2*pv_sizeof+pv_inslen(PC),$C4(a6)
  435.                 move.l  pp_variables+3*pv_sizeof+pv_insaddress(PC),$D0(a6)
  436.                 move.w  pp_variables+3*pv_sizeof+pv_inslen(PC),$D4(a6)
  437.  
  438.                 rts
  439.  
  440. pp_scr:         move.w  pp_tmpdmacon(PC),d0
  441.                 and.w   pv_dmacon(a1),d0
  442.                 beq.s   \l5
  443.  
  444.                 move.l  pv_custbase(a1),a0
  445.                 move.l  pv_insaddress(a1),(a0)
  446.                 move.w  pv_inslen(a1),4(a0)
  447.                 move.w  pv_pers(a1),6(a0)
  448.                 btst    #0,pv_flags(a1)
  449.                 bne.s   \l5
  450.                 move.l  #pp_nullwave,pv_insaddress(a1)
  451.                 move.w  #1,pv_inslen(a1)
  452.  
  453. \l5:            rts
  454.  
  455. pp_nnt:         move.b  (a0),d1         ;nt_period
  456.                 beq     \l5
  457.  
  458.                 and.l   #$000000FF,d1
  459.                 add.w   d1,d1
  460.                 add.l   #pp_periods-2,d1
  461.                 move.l  d1,a2
  462.  
  463.                 btst    #6,nt_speed(a0)
  464.                 beq.s   \l2
  465.                 move.w  (a2),pv_porlevel(a1)
  466.                 bra.s   \l5
  467.  
  468. \l2:            move.w  pv_dmacon(a1),d0
  469.                 or.w    d0,pp_tmpdmacon
  470.  
  471.                 move.l  a2,pv_peraddress(a1)
  472.                 move.w  (a2),pv_pers(a1)
  473.                 move.w  (a2),pv_pers+2(a1)
  474.                 move.w  (a2),pv_pers+4(a1)
  475.  
  476.                 clr.w   pv_por(a1)
  477.  
  478.                 move.b  nt_instr(a0),d0
  479.                 ext.w   d0
  480.                 mulu    #it_sizeof,d0
  481.                 add.l   instable(PC),d0
  482.                 move.l  d0,a2
  483.                 tst.l   it_address(a2)
  484.                 bne.s   \l1
  485.                 move.l  #pp_nullwave,pv_insaddress(a1)
  486.                 move.w  #1,pv_inslen(a1)
  487.                 clr.b   pv_flags(a1)
  488.                 bra.s   \l5
  489.  
  490. \l1:            move.l  it_address(a2),a3
  491.                 btst    #1,it_flags(a2)
  492.                 bne.s   \l0a
  493.                 move.l  it_size(a2),d0
  494.                 lsr.l   #1,d0
  495.                 move.w  d0,pv_inslen(a1)
  496.                 bra.s   \l0
  497. \l0a:           move.w  (a1),d0         ;pv_waveoffset
  498.                 add.w   d0,a3
  499.                 move.w  #$20,pv_inslen(a1)
  500. \l0:            move.l  a3,pv_insaddress(a1)
  501.                 move.b  it_flags(a2),pv_flags(a1)
  502.                 move.w  pv_vollevel(a1),pv_vol(a1)
  503.  
  504. \l5:            move.b  nt_speed(a0),d0
  505.                 and.b   #$0F,d0
  506.                 beq.s   \l6
  507.                 move.b  d0,pp_wait
  508.  
  509. \l6:            move.l  pv_peraddress(a1),a2
  510.                 move.b  nt_arpeggio(a0),d0
  511.                 beq.s   \l9
  512.                 cmp.b   #$FF,d0
  513.                 bne.s   \l7
  514.                 move.w  (a2),pv_pers(a1)
  515.                 move.w  (a2),pv_pers+2(a1)
  516.                 move.w  (a2),pv_pers+4(a1)
  517.                 bra.s   \l9
  518.  
  519. \l7:            and.b   #$0F,d0
  520.                 add.b   d0,d0
  521.                 ext.w   d0
  522.                 move.w  0(a2,d0.w),pv_pers+4(a1)
  523.                 move.b  nt_arpeggio(a0),d0
  524.                 lsr.b   #4,d0
  525.                 add.b   d0,d0
  526.                 ext.w   d0
  527.                 move.w  0(a2,d0.w),pv_pers+2(a1)
  528.                 move.w  (a2),pv_pers(a1)
  529.  
  530. \l9:            move.b  nt_vibrato(a0),d0
  531.                 beq.s   \ld
  532.                 cmp.b   #$FF,d0
  533.                 bne.s   \la
  534.                 clr.l   pv_vib(a1)
  535.                 clr.b   pv_vibcnt(a1)
  536.                 bra.s   \ld
  537. \la:            clr.w   pv_vib(a1)
  538.                 and.b   #$0F,d0
  539.                 ext.w   d0
  540.                 move.w  d0,pv_deltavib(a1)
  541.                 move.b  nt_vibrato(a0),d0
  542.                 lsr.b   #4,d0
  543.                 move.b  d0,pv_vibmax(a1)
  544.                 lsr.b   #1,d0
  545.                 move.b  d0,pv_vibcnt(a1)
  546.  
  547. \ld:            move.b  nt_phase(a0),d0
  548.                 beq.s   \l10
  549.                 cmp.b   #$FF,d0
  550.                 bne.s   \le
  551.                 clr.w   pv_phase(a1)
  552.                 move.w  #$FFFF,pv_deltaphase(a1)
  553.                 bra.s   \l10
  554. \le:            and.b   #$0F,d0
  555.                 ext.w   d0
  556.                 move.w  d0,pv_deltaphase(a1)
  557.                 clr.w   pv_phase(a1)
  558.  
  559. \l10:           move.b  nt_volume(a0),d0
  560.                 bne.s   \l10a
  561.                 btst    #7,nt_speed(a0)
  562.                 beq.s   \l16
  563.                 bra.s   \l11a
  564. \l10a:          cmp.b   #$FF,d0
  565.                 bne.s   \l11
  566.                 clr.w   pv_deltavol(a1)
  567.                 bra.s   \l16
  568. \l11:           btst    #7,nt_speed(a0)
  569.                 beq.s   \l12
  570. \l11a:          move.b  d0,pv_vol+1(a1)
  571.                 move.b  d0,pv_vollevel+1(a1)
  572.                 clr.w   pv_deltavol(a1)
  573.                 bra.s   \l16
  574. \l12:           bclr    #7,d0
  575.                 beq.s   \l13
  576.                 neg.b   d0
  577. \l13:           ext.w   d0
  578.                 move.w  d0,pv_deltavol(a1)
  579.  
  580. \l16:           move.b  nt_porta(a0),d0
  581.                 beq.s   \l1a
  582.                 cmp.b   #$FF,d0
  583.                 bne.s   \l17
  584.                 clr.l   pv_por(a1)
  585.                 bra.s   \l1a
  586. \l17:           clr.w   pv_por(a1)
  587.                 btst    #6,nt_speed(a0)
  588.                 beq.s   \l17a
  589.                 move.w  pv_porlevel(a1),d1
  590.                 cmp.w   pv_pers(a1),d1
  591.                 bgt.s   \l17c
  592.                 neg.b   d0
  593.                 bra.s   \l17c
  594.  
  595. \l17a:          bclr    #7,d0
  596.                 bne.s   \l18
  597.                 neg.b   d0
  598.                 move.w  #135,pv_porlevel(a1)
  599.                 bra.s   \l17c
  600.  
  601. \l18:           move.w  #1019,pv_porlevel(a1)
  602. \l17c:          ext.w   d0
  603. \l18a:          move.w  d0,pv_deltapor(a1)
  604.  
  605. \l1a:           rts
  606.  
  607. *** Data section ***
  608.  
  609. pp_periods:     DC.W    1019,962,908,857,809,763,720,680,642,606,572,540
  610.                 DC.W    509,481,454,428,404,381,360,340,321,303,286,270
  611.                 DC.W    254,240,227,214,202,190,180,170,160,151,143,135
  612.                 DC.W    135,135,135,135,135,135,135,135,135
  613.                 DC.W    135,135,135,135,135,135
  614.  
  615. songlen:                DS.W    1
  616. songtable:      DS.L    1
  617. instable:               DS.L    1
  618. patttable:      DS.L    1
  619.  
  620. pp_wait:                DS.B    1
  621. pp_waitcnt:     DS.B    1
  622. pp_notecnt:     DS.B    1
  623. pp_address:     DS.L    1
  624. pp_songptr:     DS.L    1
  625. pp_songcnt:     DS.W    1
  626. pp_pattentry:   DS.L    1
  627. pp_tmpdmacon:   DS.W    1
  628. pp_variables:   DS.B    4*48
  629.  
  630. songpos         ds.l    1
  631.  
  632. name            dc.b    "JamCracker",0
  633.  
  634.         section "chip",data,chip ; FIXME: This doesn't seem to work
  635.  
  636. pp_nullwave:    DS.W    1
  637.  
  638.         end
  639.